Skip to content

Conversation

embik
Copy link
Member

@embik embik commented Oct 2, 2025

Summary

The migration to multicluster-runtime (#72) left us with a big regression, only a single PublishedResource's objects were actively synced.

Turns out, we are blocking the reconcile loop for the sync manager on the first actual sync controller we start, so no further sync controllers could be started. This PR addresses that problem.

In addition, we found a design flaw in the sync manager: Since we start controllers dynamically, an Engage call by a provider might not happen when a dynamic (sync) controller is already running. As such, we retrofitted dynamic engaging of existing clusters on new sync controllers to make sure we bring them up to par with any existing controllers.

What Type of PR Is This?

/kind bug
/kind regression

Related Issue(s)

Fixes #99

Release Notes

Fix api-syncagent not reconciling objects for more than one `PublishedResource`

@kcp-ci-bot kcp-ci-bot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/regression Categorizes issue or PR as related to a regression from a prior release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 2, 2025
@embik
Copy link
Member Author

embik commented Oct 2, 2025

/retest

looks like a flake.

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
log := r.log.Named(ControllerName)
log.Debug("Processing")
log.Debugw("Processing", "request", req)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This controller only ever reconciles a dummy object, it has no meaning to log this dummy value.

}

log.Infof("storing worker at %s", key)
log.Infow("Storing worker", "key", key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this log line, I think it#s a debug leftover from my youth.

}

log.Infow("Starting new sync controller…", "key", key)
log.Infow("Creating new sync controller…", "key", key, "name", pubRes.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're at it, let's create a prlog := log.With("key", key, "name", pubRes.name) and then use prlog throughout this loop.

On-behalf-of: SAP <marvin.beckers@sap.com>
Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
@embik embik force-pushed the multiple-resources branch from 4c8ae62 to 4711cef Compare October 6, 2025 09:50
@embik
Copy link
Member Author

embik commented Oct 6, 2025

/retest

looks like kcp being slow (probably too many tests running right now).

@xrstf
Copy link
Contributor

xrstf commented Oct 6, 2025

/approve
/lgtm

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2025
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xrstf

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6f51659a8ab0d8ad2d02e8097dc8d296d213811a

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2025
@embik
Copy link
Member Author

embik commented Oct 6, 2025

/cherry-pick release-0.4

@kcp-ci-bot
Copy link
Contributor

@embik: once the present PR merges, I will cherry-pick it on top of release-0.4 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@embik
Copy link
Member Author

embik commented Oct 6, 2025

/retest

Pretty, please?

@kcp-ci-bot kcp-ci-bot merged commit 24c0c57 into kcp-dev:main Oct 6, 2025
10 checks passed
@kcp-ci-bot
Copy link
Contributor

@embik: new pull request created: #102

In response to this:

/cherry-pick release-0.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: only a single resource is actively synced
3 participants